Skip to content

Increase test coverage: Array.prototype reverse #2728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

matedabis
Copy link
Contributor

@matedabis matedabis commented Jan 24, 2019

The coverage is measured by the following script, using --jerry-test-suite --test262 --unittests --jerry-tests:
https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py
Comment added for each cases containing which part of the ES5.1 it tests.
Ran the test code in Gecko, V8, SpiderMonkey engines and got the same result.

Branch coverage:

  • Before: 28/38
  • After: 37/38

I spent a lot of time finding a way to trigger the last branch, but I could not. (ecma-builtin-array-prototype.c, line: 648) The following line needs to fail:
ECMA_TRY_CATCH (put_value, ecma_op_object_put (obj_p, upper_str_p, lower_value, true), ret_value);

Also found an opportunity to optimize, the second condition was not needed in that else if branch, as if the code reaches there, it cant be false.

JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]

Branch coverage:
Before: 28/38
After: 37//38

Also found an opportunity to optimize, the second condition was not needed
in that else if branch, as if the code reaches there, it cant be false.

JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant